package Day5_07_29;

public class Rectangle {
	private int width;
	private int high;

	public Rectangle() {
		width = 1;
		high = 1;
	}

	public Rectangle(int num) {
		width = num;
		high = num;
	}

	public Rectangle(int width, int high) {
		this.width = width;
		this.high = high;
	}


	public int perimeter() {
		int perimeter = 2 * (width + high);
		return perimeter;
//		System.out.println("周长是:" + perimeter);
	}

	public int area() {
		int area = width * high;
		return area ;
//		System.out.println("面积是：" + area);
	}
	@Override
	public String toString() {
		return "Rectangle [width=" + width + ", high=" + high + "]";
	}
	
}
